.accessibility-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #333333;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    flex-direction: row;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.accessibility-toolbar.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.accessibility-toolbar button {
    min-width: 40px;
    height: 40px;
    padding: 4px;
    border: none;
    border-radius: 4px;
    background: #4d4d4d;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
    line-height: 1;
}

.accessibility-toolbar button:hover {
    background: #666666;
}

.accessibility-toolbar button.active {
    background: #ff6b00;
}

.zoom-container {
    width: 100%;
    transform-origin: top left;
    transition: transform 0.3s ease, margin-top 0.3s ease;
    margin-top: 52px;
}

.zoom-container.toolbar-hidden {
    margin-top: 0;
}

.reading-highlight {
    background-color: rgba(66, 153, 225, 0.2) !important;
    border-radius: 4px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .accessibility-toolbar {
        padding: 2px;
        gap: 2px;
    }

    .accessibility-toolbar button {
        min-width: 36px;
        height: 36px;
        padding: 3px;
        font-size: 10px;
    }

    .contrast-menu {
        width: 100%;
        left: 0;
        transform: none;
        border-radius: 0;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .accessibility-toggle {
        top: 5px;
        right: 5px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 修改菜单控制样式 */
.contrast-control,
.rate-control {
    position: relative;
    display: inline-block;
}

.contrast-menu,
.rate-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #4d4d4d;
    padding: 4px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-top: 4px;
    width: 140px;
}

/* 确保菜单按钮样式正确 */
.contrast-menu button,
.rate-menu button {
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    background: transparent;
    color: white;
    border: none;
    border-radius: 2px;
}

.contrast-menu button:hover,
.rate-menu button:hover {
    background: #666666;
}

.contrast-menu button.active,
.rate-menu button.active {
    background: #ff6b00;
}

/* 添加工具栏切换按钮样式 */
.accessibility-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px;
    background: #ff6b00;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10000;
    font-size: 12px;
}

.accessibility-toggle.active {
    background: #2c5282;
}

.accessibility-toggle:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .accessibility-toolbar {
        background: #1a1a1a;
        border-bottom: 1px solid #333;
    }

    .contrast-menu {
        background: #1a1a1a;
        border: 1px solid #333;
    }

    .accessibility-toggle {
        background: #2d3748;
    }
    
    .accessibility-toggle.active {
        background: #1a202c;
    }
    
    .accessibility-toggle:hover {
        background: #4a5568;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .rate-menu {
        position: fixed;
        left: 0;
        right: 0;
        transform: none;
        width: auto;
        margin: 0;
        border-radius: 0;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .rate-menu {
        background: #1a1a1a;
        border: 1px solid #333;
    }

    .rate-menu button {
        background: #2d3748;
        color: #fff;
    }

    .rate-menu button:hover {
        background: #4a5568;
    }

    .rate-menu button.active {
        background: #2c5282;
    }
}

/* 选择文本朗读按钮样式 */
.selection-read-button {
    position: fixed;
    padding: 6px 12px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transition: all 0.2s;
    animation: fadeIn 0.2s ease;
}

.selection-read-button:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 删除快捷键提示相关样式 */
[data-shortcut]::after {
    content: none;
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .selection-read-button {
        background: #2d3748;
    }
    
    .selection-read-button:hover {
        background: #4a5568;
    }
}

/* 添加新功能的样式 */
.skip-links {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    transition: top 0.3s;
    z-index: 10000;
}

.skip-links a {
    background: #4299e1;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    margin: 0 5px;
}

.skip-links a:focus {
    top: 10px;
    position: relative;
}

/* 简化页面样式 */
.simplified-page {
    max-width: 800px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    font-size: 16px !important;
    line-height: 1.8 !important;
    background: #fff !important;
}

/* 减少动画 */
.reduce-motion * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* 操作反馈提示 */
.accessibility-feedback {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10002;
    animation: fadeIn 0.3s ease;
}

.accessibility-feedback.fade-out {
    animation: fadeOut 0.3s ease;
}

/* 字体菜单样式 */
.font-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #4d4d4d;
    padding: 4px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-top: 4px;
    width: 140px;
}

/* 色盲模式菜单样式 */
.filter-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #4d4d4d;
    padding: 4px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-top: 4px;
    width: 140px;
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .font-menu,
    .filter-menu {
        background: #1a1a1a;
        border: 1px solid #333;
    }

    .skip-links a {
        background: #2d3748;
    }

    .simplified-page {
        background: #1a1a1a !important;
        color: #fff !important;
    }
}

/* 纯文本模式按钮样式 */
/* .plain-text::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml,<svg viewBox="0 0 24 24" fill="white"><path d="M14 17H4v2h10v-2zm6-8H4v2h16V9zM4 15h16v-2H4v2zM4 5v2h16V5H4z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 2px;
} */

/* 图片替代文本样式 */
.img-alt-text {
    display: block;
    padding: 10px;
    margin: 10px 0;
    background: #f5f5f5;
    border-left: 4px solid #ddd;
    font-style: italic;
    color: #666;
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body.plain-text-mode * {
        background: #1a1a1a !important;
        color: #ffffff !important;
    }
    
    body.plain-text-mode a {
        color: #66b3ff !important;
    }
    
    .img-alt-text {
        background: #2d3748;
        border-color: #4a5568;
        color: #cbd5e0;
    }
}

/* 阅读指引器按钮图标 */
/* .reading-guide::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml,<svg viewBox="0 0 24 24" fill="white"><path d="M3 9h18v2H3zm0 4h18v2H3z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 2px;
} */

/* 阅读指引遮罩样式 */
.reading-guide-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
    transition: background 0.1s ease;
}

.reading-guide-highlight {
    position: fixed;
    width: 100%;
    pointer-events: none;
    z-index: 9999;
    transition: top 0.1s ease;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .reading-guide-mask,
    .reading-guide-highlight {
        display: none;
    }
}

/* 调整文字换行 */
.plain-text,
.reading-guide {
    white-space: normal;
    word-break: keep-all;
    font-size: 11px;
    line-height: 1.1;
} 